<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>转换</title>
    <style>
        *{margin: 0;padding: 0;list-style-type: none;}
    </style>
</head>
<body>
    <div></div>
    <script>
        let data = {
            name: "luoli",
            age: 18,
            sex: "女"
        }
        /* 
            JSON.parse()  将JSON格式的字符串，转换为真正的对象/数组
            JSON.stringify() 将对象 数组 转换为字符串
        */
       console.log(JSON.parse(JSON.stringify(data)));
       
    </script>
</body>
</html>